<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
<title>Insert title here</title>
<script>
$(function(){
	$('.zongcheck').on('click',function(){
		if(this.checked){
			$('input[name="subox"]').attr("checked",this.checked);	
		} 
		if(this.checked==false){
			$('input[name="subox"]').attr("checked");	
		}			
	})
	var chks=$('input[name="subox"]');
	var len=chks.length;
	while(len--){
	
	}
	
	
	$('.hdpanniu').on('click','.fh',function(){
		$('.hdpanniu').html("");
	var tj=$('<input class="button8" type="button" value="+添加" /> ');					
	var sc=$('<a class="sclj"><input class="tianjiaanniu" type="button" value="-删除" /></a>');		
	$('.hdpanniu').append(tj);
	$('.hdpanniu').append(sc);
	})
	
	$('.hdpanniu').on('click','.sclj',function(){
		var s=[];
		$("input:checked").each(function(){
			var a=$(this).attr("id");
			s.push(a);
		})
		$(this).attr('href',"guanliyuantype?id="+s+"");	
	})
	
	$('.hdpanniu').on('click','.qrtjlj',function(){
		var hydj=$('#hydj').val();
		var sxjf=$('#sxjf').val();		
		var sxzk=$('#sxzk').val();
		if(hydj==""){
			alert("填写信息不能为空！！！");
		}else if(sxjf==""){
			alert("填写信息不能为空！！！");
		}else if(sxzk==""){
			alert("填写信息不能为空！！！");
		}else if(hydj!=""&&sxjf!=""&&sxzk!=""){
			$(this).attr('href',"guanliyuantype?hydj="+hydj+"&&sxjf="+sxjf+"&&sxzk="+sxzk+"");			
		}
	})
	
	$('.hdpanniu').on('click','.button8',function(){	
		$('label').css('display','block');
		$('.huiyuan').css('display','block');
		$('.qrtj').css('display','block');
		$(this).css('display','none');
		$('.tianjiaanniu').css('display','none');
		var a=$('<label>会员等级:</label>');
		var b=$('<input class="huiyuan" id="hydj" type="text"/>');
		var c=$('<label>所需积分:</label>');
		var d=$('<input class="huiyuan" id="sxjf" type="text"/>');
		var e=$('<label>所享折扣:</label>');
		var f=$('<input class="huiyuan" id="sxzk" type="text"/>');
		var g=$('<a class="qrtjlj"><input class="qrtj" type="button" value="确认" /></a>');
		var h=$('<input class="fh" type="button" value="返回" />');	
		$('.hdpanniu').append(a);
		$('.hdpanniu').append(b);
		$('.hdpanniu').append(c);
		$('.hdpanniu').append(d);
		$('.hdpanniu').append(e);
		$('.hdpanniu').append(f);
		$('.hdpanniu').append(g);
		$('.hdpanniu').append(h);
	})
})

</script>
</head>
<style>
		.jbxxnr {
			position: relative;
			width: 100%;
			background: url(static/img/title_b.png) 10px 9px no-repeat;
			line-height: 40px;
			height: 40px;
			box-shadow: 0 1px 3px #c3c3c3;
			font-family: "Microsoft YaHei";
		}
	.jbxxwz {
	position: absolute;
	margin-top: 10px;	
	width: 100%;
	height: 500px;
	box-shadow: 0 1px 3px #c3c3c3;
}
.nr{
	position: absolute;
	width: 100%;
	margin-top: 10px;
}
table {
	border-collapse: collapse;
}
td {
	text-align: center;
	padding:8px;
	font-size:12px;
	 border: 1px solid #e2e2e2;
}
th {
	background: #f1f1f1;
	line-height: 2em;
	font-size: 12px;
	padding:8px;
	border: 1px solid #e2e2e2;
}
.button8,.tianjiaanniu,.qrtj,.fh{
	padding: 8px 30px;
	border: none;
	background: rgb(54, 156, 218);
	border-radius: 4px;
	color: white;
	margin-left:5px;
}
.hdpanniu{
	margin-top:10px;
}
 label{
font-size:12px;
}
.huiyuan{
margin-right:8px;
}
.jbxxnr span{
margin-left:50px;
}
</style>
<body>
<div>
			<div class="jbxxnr">
				<span>基本信息内容</span>
			</div>
				<div class="hdpanniu">		
					<input class="button8" type="button" value="+添加" /> 					
				<a class="sclj"><input class="tianjiaanniu" type="button" value="-删除" /></a>
				</div>
				<div class="nr">
		<table width="98.8%">
			<thead>
				<th width="2%"><input class="zongcheck" type="checkbox" /></th>
					<th width='30%'>会员等级</th>
					<th width="30%">所需积分</th>
					<th width="30%">所享折扣</th>								
			</thead>
			<tbody>
			<c:forEach var="usertype" items="${usertype}">
				<tr>
					<td width="2%"><input name="subox" type="checkbox" id="${usertype.usertypeId}"/></td>
					<td>${usertype.usertypename }</td>
					<td>${usertype.usertypeupjf }</td>
					<td>${usertype.usertypecut}</td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
				</div>
			</div>
		
</body>
</html>